package com.yue.yadmin.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class SysMenuDto implements Serializable{

	private static final long serialVersionUID = 1L;

	private SysMenu menu;
	
	private List<SysMenuDto> subMenus;
	
	public SysMenuDto() {
		super();
		this.subMenus = new ArrayList<SysMenuDto>();
	}

	public SysMenuDto(SysMenu menu, List<SysMenuDto> subMenus) {
		super();
		this.menu = menu;
		this.subMenus = subMenus;
	}

	public SysMenu getMenu() {
		return menu;
	}

	public void setMenu(SysMenu menu) {
		this.menu = menu;
	}

	public List<SysMenuDto> getSubMenus() {
		return subMenus;
	}

	public void setSubMenus(List<SysMenuDto> subMenus) {
		this.subMenus = subMenus;
	}
	
	public void addSubMenu(SysMenuDto subMenu){
		if(subMenus==null)subMenus = new ArrayList<SysMenuDto>();
		subMenus.add(subMenu);
	}

	@Override
	public String toString() {
		return "SysMenuDto [menu=" + menu + ", subMenus=" + subMenus
				+ "]";
	}

}
